home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20020314-20021006 / 000166_fdc@columbia.edu_Fri Jun 21 14:09:58 EDT 2002.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  91 lines

  1. Article: 13470 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
  3. From: fdc@columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Script dropping out to command prompt
  6. Date: 21 Jun 2002 14:09:50 -0400
  7. Organization: Columbia University
  8. Lines: 74
  9. Message-ID: <aevq5e$2bu$1@watsol.cc.columbia.edu>
  10. References: <mGKLjqv1fPVx-pn2-dLJvrE4bbu5F@inisant.jsw.gen.nz>
  11. NNTP-Posting-Host: watsol.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1024682991 13502 128.59.39.139 (21 Jun 2002 18:09:51 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 21 Jun 2002 18:09:51 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13470
  16.  
  17. In article <mGKLjqv1fPVx-pn2-dLJvrE4bbu5F@inisant.jsw.gen.nz>,
  18. Stephen Worthington <stephen@inisant.actrix.gen.nz.x> wrote:
  19. : I am trying to write a script to automate changing some settings on my Cisco
  20. : 827 router via a telnet connection.  I am using Kermit 1.1.20 for OS/2.
  21. : This is my first attempt a real Kermit script, so please let me
  22. : know if I am doing stupid things :-)
  23. : When I run the script, at a certain point I get dropped out of the script to
  24. : a Kermit command prompt.  Doing an Alt-X from there causes the script to
  25. : continue to completion.  What I do not understand is what causes Kermit to
  26. : go to a command prompt.  I can see nothing different at that point in the
  27. : script, or in the interaction with the router.
  28. : This is the script at present:  
  29. Actually it looks quite good.  You're checking INPUTs for failure, etc;
  30. which not doing is a common mistake.
  31.  
  32. : ======================================================================
  33. :
  34. : take {E:\U\K2\SCRIPTS\router_1.ksc}
  35. : if fail end 1 {router login failed}
  36. : lineout conf t
  37. : input 20 {router(config)#}
  38. : if fail end 1 {conf t failed (1)}
  39. : set input timeout-action proceed
  40. : lineout no ip inspect name DIALER-CBAC smtp
  41. : input 50 {router(config)#}
  42. : if fail end 1 {conf t failed (2)}
  43. : clear input
  44. : lineout exit
  45. : set input timeout-action proceed
  46. : set exit on-disconnect off
  47. : input 60 {router#}
  48. : xif fail {
  49. :     echo failed
  50. :     echo "\v(input)"
  51. :     end 1
  52. : }
  53. : echo succeeded
  54. : lineout exit
  55. : end 0
  56. : ======================================================================
  57. : The router_1.ksc script called at the start is a slight variation on the
  58. : standard login.ksc script that logs in to the router.  It works without
  59. : problems.  This is what I see when I run the script:
  60. : ======================================================================
  61. :
  62. : User Access Verification
  63. : Password:
  64. : router>enable
  65. : Password:
  66. : router#conf t
  67. : Enter configuration commands, one per line.  End with CNTL/Z.
  68. : router(config)#no ip inspect name DIALER-CBAC smtp
  69. : %entry not found
  70. : router(config)#exit
  71. : router#succeeded
  72. : Kermit 95 1.1.20, 31 Mar 2000, for 32-bit OS/2
  73. :  Copyright (C) 1985, 2000,
  74. It looks to me like your script is working fine, but the "exit" command,
  75. when given to the router, makes it close the connection; thus you return
  76. to K95 command mode.  Since there are no more commands in the script,
  77. and since the script did not include an EXIT command (for K95), you get
  78. the prompt.
  79.  
  80. - Frank
  81.